package com.bf.electroplating.config;

import io.minio.MinioClient;
import jakarta.annotation.Resource;
import lombok.Setter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@Setter ( onMethod_ = @Resource)
public class MinioConfig {

	private SystemConfig systemConfig;

	/**
	 * 获取 MinioClient
	 *
	 * @return MinioClient
	 */
	@Bean
	public MinioClient minioClient() {
		return MinioClient.builder().endpoint( systemConfig.getEndpoint() )
				.credentials( systemConfig.getAccessKey() ,systemConfig.getSecretKey() ).build();
	}

}
